<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<!-- Meta, title, CSS, favicons, etc. -->
<meta charset="utf-8">
<title></title>
<%
	String path = request.getContextPath();
	// 获得本项目的地址(例如: http://localhost:8080/MyApp/)赋值给basePath变量 
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	// 将 "项目路径basePath" 放入pageContext中，待以后用EL表达式读出。 
	pageContext.setAttribute("basePath", basePath);
	//out.write(basePath);
%>

<!-- Bootstrap core CSS -->
<link href="<%=basePath%>bootstrap3/css/bootstrap.min.css"
	rel="stylesheet">
<link href="data:text/css;charset=utf-8,"
	data-href="<%=basePath%>bootstrap3/css/bootstrap-theme.min.css"
	rel="stylesheet" id="bs-theme-stylesheet">
<link href="<%=basePath%>bootstrap3/css/docs.min.css" rel="stylesheet">

<script src="<%=basePath%>bootstrap3/js/jquery.min.js"></script>

<script src="<%=basePath%>bootstrap3/js/bootstrap.min.js"></script>

<script src="<%=basePath%>bootstrap3/js/docs.min.js"></script>

<script src="<%=basePath%>bootstrap3/js/ie10-viewport-bug-workaround.js"></script>

<style type="text/css">
#heads {
	height: 100px;
	width: 100%;
	background: #0099FF;
	margin-left: auto;
	margin-right: auto;
}
</style>
<script type="text/javascript">
	$(function() {
		var addo = $("#insertRe")[0].value;
		if (addo != null && addo != "") {
			alert(addo);
		}
	});
	function checkCard() {
		var card = $("#card")[0].value;
		if (card == null || card == "") {
			alert("卡号不能为空！！")
			return false;
		} else {
			return true;
		}
	}
	function checkIn() {
		var card = $("#addmoney")[0].value;
		if (card == null || card == "") {
			alert("充值金额不能为空！！")
			return false;
		} else {
			return true;
		}
	}

	function getRe(){
	 $("#in").attr("href",function(){ return "<%=basePath%>Op/insertRe.action?remain="+$("#remain")[0].value});
	 }
</script>
</head>

<body>
	<input type="hidden" id="insertRe" value="${sessionScope.insertRe }">
	<div id="heads">
		<div style="height: 10px;"></div>
		<div
			style="height: 100px; width: 60%; margin-left: auto; margin-right: auto;">
			<h1>
				<span class="glyphicon glyphicon-copyright-mark"></span>&nbsp;&nbsp;&nbsp;&nbsp;用&nbsp;户&nbsp;缴&nbsp;费&nbsp;管&nbsp;理
			</h1>
		</div>
	</div>
	<form role="form" action="<%=basePath%>Op/selectUser.action">
		<div class="form-group" align="center">
			<label for="inputPassword" class="col-md-1 control-label"><font
				size="5"> 卡号：</font></label>
			<div class="col-md-3">
				<input type="text" class="form-control" id="card" name="card"
					placeholder="用户卡号~" style="height: 45px;" onblur="checkCard();">
			</div>
		</div>
		<button type="submit" class="btn btn-primary btn-lg"
			style="height: 45px;" onclick="return checkCard();">查&nbsp;&nbsp;询</button>
	</form>
	<hr />
	<form role="form" action="<%=basePath%>Op/payMoney.action">
		<div align="center">
			<div class="row share-box-mobile show-grid">
				<div class="col-md-2">
					<font size="5" color="#303E51">户主：</font>
				</div>
				<div class="col-md-2" style="height: 56px;">
					<font size="5"> ${sessionScope.payman.username }</font>
				</div>
				<div class="col-md-1">
					<font size="5" color="#303E51">性别：</font>
				</div>
				<div class="col-md-2" style="height: 56px;">
					<font size="5"> ${sessionScope.payman.usersex }</font>
				</div>
				<div class="col-md-2">
					<font size="5" color="#303E51">出生年月：</font>
				</div>
				<div class="col-md-3" style="height: 56px;">
					<font size="5"><fmt:formatDate
							value="${sessionScope.payman.userbrity }" pattern="yyyy.MM.dd" />
					</font>
				</div>
			</div>
			<hr />
			<div class="row show-grid">
				<div class="col-md-2">
					<font size="5" color="#303E51">地址：</font>
				</div>
				<div class="col-md-4" style="height: 56px;">
					<font size="5">${sessionScope.payman.useradress }</font>
				</div>
				<div class="col-md-2">
					<font size="5" color="#303E51">身份证号：</font>
				</div>
				<div class="col-md-4" style="height: 56px;">
					<font size="5">${sessionScope.payman.useridcard }</font>
				</div>
			</div>
			<hr />
			<div class="row share-box-mobile show-grid">
				<div class="col-md-2">
					<font size="5" color="#303E51">余额：</font>
				</div>
				<div class="col-md-3" style="height: 56px;">
					<font size="5">${sessionScope.payman.useradmin }</font>
				</div>
				<div class="col-md-1">
					<font size="5" color="#303E51">（元）</font>
				</div>
				<div class="col-md-2">
					<font size="5" color="#303E51">需缴电费：</font>
				</div>
				<div class="col-md-3" style="height: 56px;">
					<font size="5">${sessionScope.allCoast }</font>
				</div>
				<div class="col-md-1" style="height: 56px;">
					<font size="5" color="#303E51">（元）</font>
				</div>
			</div>
			<hr />
			<div class="row share-box-mobile show-grid">
				<div class="col-md-2">
					<font size="5" color="#303E51">充值：</font>
				</div>
				<div class="col-md-3" style="height: 56px;">
					<input type="text" id="addmoney" name="addmoney"
						class="form-control" placeholder="请输入充值的钱~" style="height: 40px;">
				</div>
				<div class="col-md-1">
					<font size="5" color="#303E51">（元）</font>
				</div>
				<div class="col-md-1">
					<font size="5" color="#303E51">找零：</font>
				</div>
				<div class="col-md-2" style="height: 56px;">
					<%-- <font size="5">${sessionScope.remainMoney }</font> --%>
					<c:if test="${sessionScope.remainMoney!=null }">
					<input type="text" id="remain" name="remain" class="form-control"
						value="${sessionScope.remainMoney }" style="height: 40px;" onblur="getRe();">
				</c:if>
				</div>
				<div class="col-md-1" style="height: 56px;">
					<font size="5" color="#303E51">（元）</font>
				</div>

				<div class="col-md-2" style="height: 56px;">
					<c:if test="${sessionScope.remainMoney!=null }">
						<a href="<%=basePath%>Op/insertRe.action?remain=${sessionScope.remainMoney }" id="in" role="button"
							class="btn btn-success  btn-lg active"
							style="width: 150px; height: 40px;">&nbsp;&nbsp;存&nbsp;&nbsp;入&nbsp;&nbsp;</a>
					</c:if>
				</div>
			</div>
			<hr />
			<div class="row">
				<div class="col-md-6">
					<button type="submit" class="btn btn-danger btn-lg"
						style="width: 150px; height: 45px;" onclick="return checkIn();">&nbsp;&nbsp;缴&nbsp;&nbsp;费&nbsp;&nbsp;</button>
				</div>
				<a href="<%=basePath%>Op/queryBill.action"
					class="btn btn-primary btn-lg active" role="button"
					style="width: 150px; height: 45px;">查&nbsp;看&nbsp;账&nbsp;单</a>
			</div>
		</div>
	</form>

</body>

</html>